import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:qgchat/common/global/global.dart';

///
/// 广场头像
///

class SquareAvatar extends StatelessWidget {
  const SquareAvatar({this.avatarUrl, Key key}) : super(key: key);

  final String avatarUrl; // 头像

  @override
  Widget build(BuildContext context) {
    return ClipOval(
      child: Container(
        width: px(90),
        height: px(90),
        color: col("e4007f"),
        child: CachedNetworkImage(
          imageUrl: "$avatarUrl",
          fit: BoxFit.cover,
          errorWidget: (context, url, error) {
            return Config.errorNetImage;
          },
        ),
      ),
    );
  }
}
